from urllib.request import urlopen
from urllib.error import HTTPError
from bs4 import BeautifulSoup


def getTitle(url):
    try:
        html = urlopen(url)
    except HTTPError as e:
        print("网络链接错误")
        return
    try:
        bsObj = BeautifulSoup(html.read())